package com.java8.lambda;

import java.util.function.BinaryOperator;
import java.util.function.Predicate;

import javax.swing.JButton;

import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class LambdaApplication {

    public static void main(String[] args) {
//        SpringApplication.run(LambdaApplication.class, args);
    	Predicate<Integer> atLeast5 = x -> x > 5;
    	System.err.println(atLeast5.test(4));
    	System.err.println(atLeast5.test(8));
    	BinaryOperator<Long> addLongs = (x, y) -> {
    		    x *= 10;
    		    y *= 20;
    		    return x + y;
    		};
    	System.err.println(addLongs.apply(1l, 2l));
    	
    	Function<Integer, String> f = x -> x+1+"";
    	System.err.println(f.apply(1));
    	
    	Runnable helloWorld = () -> System.out.println("hello world");
    	JButton button = new JButton();
    	button.addActionListener(event ->
    	System.out.println(event.getActionCommand()));
    }

}
